
 <template>
    <div class="layout-container">
      <div class="layout-header">
        <HeaderView />
      </div>
      <main class="layout-content">
        <router-view />
      </main>
    </div>
    <!-- 返回顶部 -->
    <div class="back-top" @click="handleBackTop">
      <UpIcon />
    </div>
</template>



<script setup lang="ts">
import HeaderView from "@/components/HeaderView.vue";
import UpIcon from "@/components/icons/UpIcon.vue";
const handleBackTop = () => {
  window.scrollTo({
    top: 0,
    behavior: 'smooth',
  });
}
</script>

<style scoped lang="less">
.back-top {
  position: fixed;
  bottom: 100px;
  right: 50px;
  border-radius: 50%;
  background-color: #fff;
  padding: 10px;
  width: 40px;
  height: 40px;
}
.layout-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  .layout-header {
    height: 64px;
    background-color: #fff;
    padding: 10px;
  }
  .layout-content {
    flex: 1;
    margin: 0 auto;
    width: 1100px;
    padding: 10px;
    
  }
}
@media (max-width: 768px) {
  .layout-content {
    padding: 5px;
  }
  .back-top {
    bottom: 50px;
    right: 20px;
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .layout-header {
    padding: 5px;
  }
  .layout-content {
    padding: 5px;
  }
  .back-top {
    bottom: 30px;
    right: 10px;
    width: 30px;
    height: 30px;
  }
}
</style>


